<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>生成器的应用</title>
	</head>
	<body>
		<script type="text/javascript">
			function frist(){
				setTimeout(()=>{
					document.write(111);
					zxc.next();
				},1000)
			}
				function two(){
				setTimeout(()=>{
					document.write(222);
					zxc.next();
				},2000)
			}
					function three(){
				setTimeout(()=>{
					document.write(333);
					zxc.next();
				},3000)
			}
			function * gen(){
			yield frist();
			yield two();
			yield three();
				
			}
			let zxc=gen();
			zxc.next();
		</script>
	</body>
</html>
